package com.lcj.odr.controller;

import com.github.pagehelper.PageInfo;
import com.lcj.common.util.Result;
import com.lcj.odr.controller.form.SearchMonitoringForm;
import com.lcj.odr.db.pojo.OrderMonitoringEntity;
import com.lcj.odr.service.MonitoringService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/monitoring")
public class MonitoringController {

    @Resource
    private MonitoringService monitoringService;

    @PostMapping("/searchOrderMonitoringByPage")
    public Result searchOrderMonitoringByPage(@RequestBody @Valid SearchMonitoringForm form){
        PageInfo<OrderMonitoringEntity> list = monitoringService.searchOrderMonitoringByPage(form);
        return Result.ok().put("result", list);
    }

}
